<template>
	<view class="">
		<!-- 通过v-bind向子组件传值 -->
		<!-- <child :text="text" v-on:change="change"></child> -->
		<child :text="text" @change="change"></child>
		{{title}}
	</view>
</template>
<script>
	// 组件中不能包含大写字母,有大写字母需要驼峰命名
	import child from '../../components/child.vue';
	export default {
		components:{
			child
		},
		data() {
			return {
				text:"我是父组件",
				title:""
			}
		},
		onLoad() {

		},
		methods: {
			change(res){
				console.log(res)
				this.title = res;
			}
		}
	}
</script>
<style>
</style>
